﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// 滑翔行为
/// </summary>
public class FlyAct : IAction{
    [Tooltip("空气阻力")]
    public float flyDrag=30;
    [Tooltip("上升加速度")]
    public float upG = 3;

    public override void GetAction()
    {
        if (mva.IsGround) return;
        if (Input.GetKeyDown(KeyCode.Space)) 
        mva.isFlying = !mva.isFlying;//反向。

    }
    public override void Init()
    {
        mva.OnIsGroundChange += (isGround) => { if (isGround) mva.isFlying = false; };
    }

    public FlyAct(PlayerController pc,float flyDrag=15f) : base(pc) { this.flyDrag = flyDrag; }
	
}
